package com.restkeeper.gateway.config.customCode.HandlerRexecute;

import com.restkeeper.gateway.config.customCode.dic.CodeConstants;
import com.restkeeper.gateway.config.customCode.handler.CustomCodeHandler;
import com.restkeeper.gateway.config.customCode.utils.CustomCodeUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import java.util.Map;

@Slf4j(topic = "custom-code")
@Component(CodeConstants.BEAN_PREFIX + CodeConstants.MessageType.CODE_ENCODED)
public class Encoded implements CustomCodeHandler {

    /**
     * 编码
     * */
    @Override
    public String handle(Map<String, String> params) {
         String ip = params.get("ip");
        return CustomCodeUtils.getCustomEncoded(ip);
    }
}
